<!DOCTYPE html>
<title>面向切面编程/装饰者模式</title>
<body>
    <button id="button" tag="login">点击打开登录浮层</button>
    <form>
        <input type="text" id="username" />
        <input type="password" id="password" />
        <input type="button" id="submitBtn" value="提交" />
    </form>
</body>
<script>
let _log = function(where, ..._data) {
    console.info(
        `%c${where}：`,
        'background: #2a3b4c; padding: 5px; color: #fff; border-radius: 2px', 
        _data.join(', ')
    )
}
console = window.console || console;
console.log = (function(log) {
    return function (data) {
        try{
            log.call(console, ...arguments);
        } catch (e) {
            console.error(`console.log error`, e);
        }
    }
})(_log)
</script>
<script type="text/javascript" src="aop-1.js"></script>
